//
//  OneTableViewCell.swift
//  BusinessIOS
//
//  Created by Rain on 2018/12/26.
//  Copyright © 2018 XingJian Li. All rights reserved.
//

import UIKit

class OneTableViewCell: UITableViewCell {
    var BgImage:UIImageView!
    
    var nameLabel:UILabel!
    
    required init?(coder aDecoder: NSCoder) {
        
        super.init(coder: aDecoder)
        
    }
    
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        self.lauoutUI()
        
    }
    
    func lauoutUI() {

        
        self.BgImage = UIImageView()
        
        self.BgImage.backgroundColor = UIColor.red
        
        self.contentView.addSubview(self.BgImage!)
        

        
        self.nameLabel = UILabel()
        
        self.nameLabel.text = "201800108"
        self.nameLabel.textAlignment = .center
        
        self.nameLabel.textColor = UIColor.white
        
          self.nameLabel.font = UIFont.systemFont(ofSize:15)//一般方法
        
        self.BgImage.addSubview(self.nameLabel!)
  
    }
    
    override func layoutSubviews() {
        
        super.layoutSubviews()
        
       
        
        self.BgImage.frame = CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height)
        
        
        self.nameLabel.frame = CGRect(x: 0, y: self.BgImage.frame.size.height - 40, width: self.frame.size.width, height: 40)
      
        
        
    }
    
    
    

    

}
